#!/usr/bin/env python
#coding=utf-8
from flask import url_for,redirect,request,jsonify,Response
from Applications.libs.redprint import Redprint
from Applications.libs import utils
from Applications.libs.exception import Success,ParameterException,NotFound,Failed
from Applications.services import linksService , MenuService
import json



Routine_API = Redprint('Routines')
@Routine_API.route('/DEFAULT_SERVICE',methods=['get','post'])
def Default_API():
    print('test')
    #raise NotFound()
    #return utils.reluesInfo(100).dumps()
    #return Success(0)
    #return Failed("修改密码失败")

    list = linksService.linksService.links_list()
    #return utils.utils.ListToJsonify(list)
    return json.dumps(list,cls=utils.chemyEncoder)
    #return jsonify(list)


@Routine_API.route('/HOME_MENUS_SERVICE',methods=['get','post'])
def HOME_MENUS_API():
    list = MenuService.homemenusService.get_homeMenus()

    #return jsonify(list)
    return json.dumps(list,cls=utils.AlchemyEncoder)
